<?php 
/***Create By fu**/
namespace app\api\controller\v1;

use app\api\model\Banner as BannerModel;
use app\api\validate\IDMustBePostiveInt;
use app\lib\exception\BannerMissException;
 
/**
* 
*/
class Banner
{
	/** 获取指定id的banner信息
	 * @url /banner/:id
	 * @http GET
	 * @id  banner的id号
	 */
	public function getBanner($id){
		 
		(new IDMustBePostiveInt)->goCheck();
		 
	    $banner = BannerModel::getBannerByID($id);
	     
		if(!$banner)throw new BannerMissException(['msg'=>'banner为空','error_code'=>10086]);
	 
        return $banner;
       
	}
    // z.cn/api/v1/test
	public function test(){
		// $request = Request::instance();
		// $params = $request->param();
		$num = input('num');
		$arr = [
				'code'=>400,
				'msg'=>'不错',
			];

 		dump(getRandChars($num));
	}
}




 ?>